<template>
  <a-layout class="left">
    <a-tree
      :tree-data="treeData"
      :selectedKeys='selectedKeys'
      @select="handleSelect"
    />
  </a-layout>
</template>
<script setup>
import { storeToRefs } from "pinia";
import { useFormStore } from "@/form/design-mode/store/formStore";
const formStore = useFormStore();
const { treeData, selectedKeys } = storeToRefs(formStore);
const handleSelect = (selectedKeys) => {
  formStore.setSelected(selectedKeys[0]);
};
</script>

<style scoped>
.left {
  height: 100%;
  width: 240px;
  background-color: #fff;
  flex: unset;
}
</style>
